package com.bishe.app.modules.menu.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * Created : 2024/3/15, 17:10
 *
 * @author : jeffrey.hu
 **/
@AllArgsConstructor
@Getter
public enum MenuType {

    PAGE(1,"页面"),
    BTN(2,"按钮")

    ;

    private Integer code;

    private String desc;


    public static MenuType ofCode(Integer code) {
        for (MenuType value : values()) {
            if (Objects.equals(value.getCode(), code)) {
                return value;
            }
        }
        return null;
    }
}
